<?php
/**
 * 海外仓-移库日志
 * (model)
 */
namespace App\Models\OverSeasBa;

use Encore\Admin\Facades\Admin;
use Illuminate\Database\Eloquent\Model;

class RemovaleLog extends Model{

    protected $table = 'os_b_removale_log';

    protected $guarded = [];

    public static function logs($data = [],$userId = null){
        self::create([
            'warehouse_id' => $data['warehouse_id'],
            'account_id' => $data['account_id'],
            'fnsku' => $data['fnsku'],
            'psku_id' => $data['psku_id'],
            'num' => $data['num'],
            'after_num' => $data['after_num'],
            'before_num' => $data['before_num'],
            'ouser_id' => $userId ?: Admin::user()->id
        ]);
    }

}
